/**
 * @description: 工时参数校验
 * @version: 0.0.1
 * @author: z..
 * @Date: 2023-06-08 14:07:35
 */

import { Rule, RuleType } from '@midwayjs/validate';
import { requiredNumber, requiredString, requiredAny } from "./common";

export class CommonWork {
  @Rule(requiredString)
  workTitle: string;
  @Rule(RuleType.any())
  startTime: string;
  @Rule(requiredString)
  endTime: string;
}

export class CreatedWorkingDTO extends CommonWork{
  @Rule(requiredAny)
  workArray: any;
}

export class UpdateWorkingDTO extends CommonWork{
  @Rule(requiredNumber)
  id: number;
  @Rule(requiredNumber)
  workAmount: number;
  @Rule(requiredNumber)
  projectsId: number;
  @Rule(RuleType.any())
  remarks: any;
}

export class SetWorkAmountDTO {
  @Rule(requiredNumber)
  id: number;
  @Rule(requiredString)
  union_id: string;
}
